﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OnlineManagement.Common
{
   public class PubSessions
    {
       public static readonly string HoggeryIDSessionStr = "HoggeryID";
       public static readonly string HoggeryNameSessionStr = "HoggeryName";

       public static readonly string UserNameSeesionStr = "UserName";


       public static string CacheHoggeryID {
           get {
              object idObj= DataCache.GetCache(HoggeryIDSessionStr);
               if(idObj!=null){
                   return idObj.ToString();
               }
               return string.Empty;
           }
           set {
               DataCache.SetCache(HoggeryIDSessionStr, value);
           }
       }

       public static string CacheHoggeryName {
           get {
               object nameObj = DataCache.GetCache(HoggeryNameSessionStr);
               if(nameObj!=null){
                   return nameObj.ToString();
               }
               return string.Empty;
           }
           set {
               DataCache.SetCache(HoggeryNameSessionStr, value, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5));
           }
       }


    }
}
